Reduce Magellan read timeout to 5 tries. Treat "-" on UNIX as a file, not a serial...
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 19 Jun 2006 21:15:29 +0000 (21:15 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 19 Jun 2006 21:15:29 +0000 (21:15 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2168 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/magproto.c

index 10ea3fe5a78b698ef62236b807fd8742d63f756e..b213655584a78d00e56eb299f84e1934e26c577c 100644 (file)
@@ -266,7 +266,7 @@ static void
 mag_writemsg(const char * const buf)
 {
        unsigned int osum = mag_checksum(buf);
-       int retry_cnt = 20;
+       int retry_cnt = 5;
        int i;
        char obuf[1000];
 
@@ -671,7 +671,7 @@ terminit(const char *portname, int create_ok)
 
         magfile_in = xfopen(portname, "rb", MYNAME);
 
-       is_file = !isatty(fileno(magfile_in)) || explorist;
+       is_file = (0 == strcmp(portname,"-")) || !isatty(fileno(magfile_in)) || explorist;
        if (is_file) {
                icon_mapping = map330_icon_table;
                mag_cleanse = m330_cleanse;
@@ -840,7 +840,7 @@ mag_wr_init_common(const char *portname)
        }
 #else
        magfile_out = xfopen(portname, "w+b", MYNAME);
-       is_file = !isatty(fileno(magfile_out)) || explorist;
+       is_file =  (0 == strcmp(portname,"-")) || !isatty(fileno(magfile_out)) || explorist;
 #endif
 
        if (!mkshort_handle) {